

def line2words(line: str):
    line1 = line.strip(" ")
    line2 = line1.strip("\n")
    words = line2.split(" ")
    words_len = len(words)
    head_index = 0
    for j in range(words_len):
        if words[j] == "0x29":
            head_index = j
            break
    if head_index <= 0:
        print()
        return
    head_index = head_index + 1
    print(words[head_index] + " ", end="")
    print('0x{:02x}'.format(words_len-2) + " ", end="")
    for j in range(head_index, words_len):
        print(words[j] + " ", end="")
    print("\b")


f_ori = open("test.txt", "r")
ori_lines = f_ori.readlines()
ori_lines_len = len(ori_lines)
for i in range(ori_lines_len):
    line2words(ori_lines[i])

f_ori.close()




